home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD Ware Multimedia 1995 May
/
cd Ware (Juegos) Epimundo.iso
/
WIN
/
UT_SYSTM
/
INITYME.ZIP
/
INITYME.MNU
< prev
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
MarxMenu script
|
1994-11-17
|
24.9 KB
|
1,088 lines
Comment
==========================================================
Computer Tyme IniTyme * Copyright 1993-94 by Marc Perkel
All Rights Reserved
Computer Tyme * 411 North Sherman, Suite 300 * Springfield Mo. 65802
(800) 548-5353 Sales * (417) 866-1222 Voice * (417) 866-1665 Data/Fax
IniTyme is a Windows *.INI file manipulator. It is designed to assist the
network administrator who has to maintain INI files for many users.
USAGE: INITYME ChangeFile IniFile
Example:
INITYME CHANGE.INI SYSTEM.INI
==========================================================
EndComment
;------ Create Variables
var
Orig
KOrig
Changes
UChanges
NameIndex
BlockStartIndex
BlockEndIndex
CurrentSection
ThisSection
NeedsIndexing
SectionStart
SectionEnd
SubFind
SubReplace
SubFindG
SubReplaceG
GroupSection
GroupMode
Sections
InsertPos
Logging
LogHandle
LogGroup
LogFirstLine
NoBackup
RestoreMode
TestMode
ChangeFileName
IniFileName
IniToolMode
ProgName
Yak
Quiet
GlobalDups
BackupExtension
BackupName
FirstProcessFile
var
IfArray
Stack
GotoList
IfLine
GroupList
ParenLevel
Main
;======================= P R O C E D U R E S ===========================
Procedure IndexFile
var LastTextLine St
Loop Orig
St = CleanIniLine(LoopVal)
if St StartsWith '['
;-- Process Header
ThisSection = St
GroupSection = ThisSection = '[GROUPS]'
CurrentSection = CurrentSection + 1
AppendArray(NameIndex,St)
AppendArray(BlockStartIndex,succ(LoopIndex))
if CurrentSection > 1
AppendArray(BlockEndIndex,LastTextLine)
endif
else
if St > ''
LastTextLine = LoopIndex
KOrig[LoopIndex] = KeyString(St)
endif
endif
EndLoop
Sections = CurrentSection
CurrentSection = 0
if Sections > 0
AppendArray(BlockEndIndex,LastTextLine)
endif
NeedsIndexing = False
TestFreeMemory
EndProc
Procedure KeyString (St)
var KeyWord
KeyWord = LeftOfEqual(St)
if Hash(KeyWord + ThisSection)
;- duplicates allowed
Return St
endif
GroupMode = False
if GroupSection
if St StartsWith 'GROUP'
GroupMode = True
KeyWord = 'GROUP=' + FilePart(RightOfEqual(St))
endif
endif
Return KeyWord
EndProc
;----- When adding or deleting the BlockStartIndex must be updated
Procedure AdjustLineIndex (Line, Adj)
Loop BlockStartIndex
if LoopVal > Line
LoopVal = LoopVal + Adj
endif
EndLoop
Loop BlockEndIndex
if LoopVal >= (Line - Adj)
LoopVal = LoopVal + Adj
endif
EndLoop
SectionStart = BlockStartIndex[CurrentSection]
SectionEnd = BlockEndIndex[CurrentSection]
if InsertPos >= Line
InsertPos = InsertPos + Adj
endif
EndProc
Procedure LogEvent ($St)
if not (Logging or Yak) then Return
if LogGroup <> ThisSection
if (LogGroup <> '') or LogFirstLine
;- First line of this log session
if LogFirstLine
FileLog(LogHandle,'')
FileLog(LogHandle,'======================================================')
FileLog(LogHandle,'')
FileLog(LogHandle,'MainFile=' + IniFileName)
FileLog(LogHandle,'ChangeFile=' + ChangeFileName)
if NovLoginName > ''
FileLog(LogHandle,'User=' + NovLoginName)
endif
FileLog(LogHandle,'Time: ' + DateString + ' ' + TimeString)
FileLog(LogHandle,'')
FileLog(LogHandle,'======================================================')
endif
FileLog(LogHandle,'')
if Yak then Writeln
FileLog(LogHandle,ThisSection)
if Yak then Writeln ThisSection
endif
LogFirstLine = False
LogGroup = ThisSection
endif
FileLog(LogHandle,St)
if Yak then Writeln St
EndProc
Procedure DelLine (Line)
if Line = 0 then Return
LogEvent ' Deleted: ' Orig[Line]
Delete(Orig,Line,1)
Delete(KOrig,Line,1)
AdjustLineIndex(Line,-1)
EndProc
Procedure InsertLine (St,Line)
ArrayInsert(Orig,Line,1)
ArrayInsert(KOrig,Line,1)
Orig[Line] = St
KOrig[Line] = KeyString(CleanINILine(Orig[Line]))
EndProc
;----- Change a line, 0 for line number adds line
Procedure ChangeOrAddLine (St,Line)
var Original
if Line = 0
;- add new line
if CurrentSection > 0
if GroupMode
St = 'Group' + Str(NextGroup) + '=' + RightOfEqual(St)
endif
;- Determine Insert Position
if InsertPos = 0
Line = BlockEndIndex[CurrentSection] + 1
InsertLine(St,Line)
AdjustLineIndex(Line,1)
else
Line = InsertPos
InsertPos = 0
InsertLine(St,Line)
AdjustLineIndex(Line,1)
endif
LogEvent ' Added: ' St
endif
else
;- change line
Original = Orig[Line]
if InsertPos > 0
;- move the line
Delete(Orig,Line,1)
Delete(KOrig,Line,1)
Line = InsertPos
InsertLine(St,Line)
InsertPos = 0
endif
if GroupMode
St = LeftOfEqual(Orig[Line]) + RightOfEqual(St)
endif
if St <> Original
LogEvent ' Changed: ' Original ' to ' St
Orig[Line] = St
KOrig[Line] = KeyString(CleanIniLine(Orig[Line]))
endif
endif
EndProc
Procedure SetSectionInfo
if CurrentSection = 0
ThisSection = ''
GroupSection = False
SectionStart = 0
SectionEnd = 0
else
ThisSection = NameIndex[CurrentSection]
SectionStart = BlockStartIndex[CurrentSection]
SectionEnd = BlockEndIndex[CurrentSection]
GroupSection = ThisSection = '[GROUPS]'
HashLevel = 2
Loop GlobalDups
Hash(LoopVal + ThisSection) = True
EndLoop
HashLevel = 1
endif
EndProc
Procedure FindSection (St)
if NeedsIndexing then IndexFile
CurrentSection = PosInList(St,NameIndex)
SetSectionInfo
EndProc
Procedure AddSection (St)
var Lines Proc
Proc = CleanIniLine(St)
;- Add a blank line
AppendArray(Orig,'')
AppendArray(KOrig,'')
;- Add CurrentSection header
AppendArray(Orig,St)
AppendArray(KOrig,Proc)
;- Update Indexes
Lines = NumberOfElements(Orig)
AppendArray(NameIndex,Proc)
AppendArray(BlockStartIndex,Lines + 1)
AppendArray(BlockEndIndex,Lines + 1)
;- Make new CurrentSection the current CurrentSection
CurrentSection = NumberOfElements(NameIndex)
SetSectionInfo
if Logging
LogGroup = UpperCase(St)
LogEvent ''
LogEvent LogGroup ' -*- Section Added'
endif
EndProc
Procedure DelSection (St)
var S E D
FindSection(St)
if CurrentSection = 0 then Return
S = BlockStartIndex[CurrentSection] - 1
E = BlockEndIndex[CurrentSection]
D = E - S + 1
delete(Orig,S,D)
delete(KOrig,S,D)
delete(NameIndex,CurrentSection,1)
delete(BlockStartIndex,CurrentSection,1)
delete(BlockEndIndex,CurrentSection,1)
AdjustLineIndex(S,0 - D)
CurrentSection = 0
if Logging
LogGroup = ''
LogEvent ''
LogEvent UpperCase(St) ' -*- Section Deleted'
endif
EndProc
Procedure FindLine (St)
; Writeln '=> ' St ' ' KeyString(St)
Return PosInList(KeyString(St),KOrig,SectionStart,SectionEnd)
EndProc
;----- Replaces text in block from the list of substitute text.
Procedure ApplySubstBlock (SubF,SubR,S,E)
var P St
if NumberOfElements(SubF) = 0 then Return
UpperCaseCompare On
while S <= E
Loop SubF
St = Orig[S]
Substitute(Orig[S],SubF[LoopIndex],SubR[LoopIndex])
if St <> Orig[S] then ChangeOrAddLine(Orig[S],S)
EndLoop
S = S + 1
endwhile
UpperCaseCompare Off
dispose(SubFind)
dispose(SubReplace)
EndProc
Procedure ApplySubst
if CurrentSection = 0 then Return
ApplySubstBlock(SubFind,SubReplace,BlockStartIndex[CurrentSection],BlockEndIndex[CurrentSection])
ApplySubstBlock(SubFindG,SubReplaceG,BlockStartIndex[CurrentSection],BlockEndIndex[CurrentSection])
EndProc
Procedure NextGroup
var X S E St Match
X = 1
repeat
S = BlockStartIndex[CurrentSection]
E = BlockEndIndex[CurrentSection]
Match = False
while (S <= E) and not Match
St = 'GROUP' + Str(X)
Match = pos(St,CleanIniLine(Orig[S])) > 0
S = S + 1
endwhile
if not Match then Return X
X = X + 1
until False
EndProc
Procedure RemoveExtraBlankLines
var Tmp
Trim(Orig)
Tmp = Orig
dispose Orig
Loop Tmp
if LoopVal > ''
TrimTrail(LoopVal)
AppendArray(Orig,LoopVal)
endif
EndLoop
Tmp = Orig
dispose Orig
Loop Tmp
if LoopIndex > 1
if LoopVal StartsWith '['
AppendArray(Orig,'')
endif
endif
AppendArray(Orig,LoopVal)
EndLoop
EndProc
Procedure AddItem (Line)
var St List New UNew NewLine Next UNext
St = CleanIniLine(Orig[Line])
New = RightOfEqual(Changes[LoopIndex])
UNew = RightOfEqual(UChanges[LoopIndex])
St = RightOfEqual(St)
NewLine = Orig[Line]
while St > ''
AppendArray(List,NextWord(St))
endwhile
while UNew > ''
Next = NextWord(New);
UNext = NextWord(UNew);
if PosInList(UNext,List) = 0
NewLine = NewLine + ' ' + Next
endif
endwhile
TrimTrail(NewLine)
;- delete double spaces
while pos(' ',NewLine) > 0
Delete(NewLine,pos(' ',NewLine),1)
endwhile
;- delete space after =
if pos('= ',NewLine) > 0
Delete(NewLine,pos('= ',NewLine)+1,1)
endif
ChangeOrAddLine(NewLine,Line)
EndProc
Procedure DelItem (Line)
var St List New UNew NewLine Next UNext P
St = CleanIniLine(Orig[Line])
UNew = RightOfEqual(UChanges[LoopIndex])
St = St + ' '
NewLine = Orig[Line]
while UNew > ''
UNext = NextWord(UNew);
P = pos(UNext + ' ',St)
if P > 0
delete(St,P,length(UNext) + 1)
delete(NewLine,P,length(UNext) + 1)
endif
endwhile
TrimTrail(NewLine)
;- delete double spaces
while pos(' ',NewLine) > 0
Delete(NewLine,pos(' ',NewLine),1)
endwhile
;- delete space after =
if pos('= ',NewLine) > 0
Delete(NewLine,pos('= ',NewLine)+1,1)
endif
ChangeOrAddLine(NewLine,Line)
EndProc
Procedure TrailEqu (St)
if St contains '='
Return St
else
Return St + '='
endif
EndProc
Procedure OpenLog (RestOfLine)
var LogFileName
LogFileName = RestOfLine
if LogFileName = ''
LogFileName = ForceExtension(IniFileName,'LOG')
endif
LogFileName = DefaultExtension(LogFileName,'LOG')
FileAssign(LogHandle,LogFileName)
LogFirstLine
Logging
EndProc
Procedure ChangeFile
var St New Line Tmp FirstWord RestOfLine LogFileName X Y
Loop Changes
New = LoopVal
St = UChanges[LoopIndex]
if St > ''
RestOfLine = St
FirstWord = NextWord(RestOfLine)
if Hash(FirstWord)
St = RestOfLine
Tmp = NextWord(New)
if CurrentSection = 0
if FirstWord = 'TESTMODE'
TestMode
elseif FirstWord = 'LOG'
OpenLog(RestOfLine)
FileCreate(LogHandle)
elseif FirstWord = 'APPENDLOG'
OpenLog(RestOfLine)
FileAppend(LogHandle)
elseif FirstWord = 'NOBACKUP'
NoBackup = True
elseif FirstWord = 'YAK'
if not Quiet
Writeln
Yak = True
endif
elseif FirstWord = 'BACKUPNAME'
BackupName = Uppercase(NextWord(RestOfLine))
if BackupName StartsWith '*.'
BackupExtension = BackupName
delete(BackupExtension,1,2)
BackupName = ''
endif
elseif FirstWord = 'DUPLICATES'
if RightOfEqual(RestOfLine) = '[*]'
AppendArray(GlobalDups,LeftOfEqual(RestOfLine))
else
Hash(RestOfLine) = True
endif
LoopVal = ''
UChanges[LoopIndex] = ''
endif
endif
if FirstWord = 'DEL'
if RestOfLine StartsWith '['
ApplySubst
DelSection(RestOfLine)
else
RestOfLine = TrailEqu(RestOfLine)
DelLine(FindLine(RestOfLine))
endif
elseif FirstWord = 'ADD'
Line = FindLine(St)
if Line = 0
ChangeOrAddLine(New,0)
endif
elseif FirstWord = 'CHANGE'
Line = FindLine(St)
if Line > 0
ChangeOrAddLine(New,Line)
endif
elseif FirstWord = 'ADDVALUE'
Line = FindLine(St)
if Line > 0
X = Value(RightOfEqual(New)) + Value(RightOfEqual(Orig[Line]))
Tmp = LeftOfEqual(New)
ChangeOrAddLine(Tmp + Str(X),Line)
endif
elseif FirstWord = 'ADDITEM'
Line = FindLine(St)
if Line > 0
AddItem(Line,St)
else
ChangeOrAddLine(New,0)
endif
elseif FirstWord = 'DELITEM'
Line = FindLine(St)
if Line > 0
DelItem(Line,St)
endif
elseif FirstWord = 'SUBST'
if CurrentSection = 0
AppendArray(SubFindG,CleanIniLine(NextWord(St)))
AppendArray(SubReplaceG,NextWord(St))
else
AppendArray(SubFind,CleanIniLine(NextWord(St)))
AppendArray(SubReplace,NextWord(St))
endif
elseif FirstWord = 'BEFORE'
St = TrailEqu(St)
InsertPos = FindLine(St)
elseif FirstWord = 'AFTER'
St = TrailEqu(St)
X = FindLine(St)
if X > 0 then InsertPos = succ(X)
elseif FirstWord = 'FIRST'
InsertPos = BlockStartIndex[CurrentSection]
endif
else
;- Process Sections
if St StartsWith '['
;- New Group
ApplySubst
FindSection(St)
if CurrentSection = 0
AddSection(LoopVal)
endif
else
;- Process Lines
ChangeOrAddLine(New,Findline(St))
endif
endif
endif
IfLine = IfArray[LoopIndex]
if IfLine > ''
Interpret
if NumberOfElements Stack <> 0
Error ('Too Many Parameters!',LoopIndex)
endif
endif
EndLoop
ApplySubst
ApplySubstBlock(SubFindG,SubReplaceG,1,NumberOfElements(Orig))
EndProc
Procedure Help
var Help HelpFile St
St = ForceExtension(FilePart(MenuFileName),'HLP')
HelpFile = ExistOnPath(St)
if HelpFile = ''
St = ForceExtension(FilePart(MenuFileName),'TXT')
HelpFile = ExistOnPath(St)
endif
Writeln
if HelpFile > ''
BoxHeader ' Viewing ' + HelpFile + ' '
DrawBox 1 1 ScreenWidth ScreenHeight
ViewTextFile(HelpFile)
endif
StandardIO
Writeln ProgName ' * Version 2.44 * Release Date: 11-17-94'
if IniToolMode
Writeln
Writeln 'Copyright 1994 by McAfee Inc. (408) 988-3832'
Writeln 'Copyright 1993-94 by Computer Tyme Inc. (417) 866-1222'
Writeln 'Licensed to McAfee Inc. from Computer Tyme Inc.'
Writeln 'All Rights Reserved'
else
Writeln 'Copyright 1993-94 by Marc Perkel * All Rights Reserved'
Include 'ADDRESS.INC'
endif
if HelpFile = ''
Writeln 'Missing file: ' St
endif
ExitMenu
EndProc
Procedure Beg
var Jessica
BoxHeader ' * Shameless Beg Screen * '
DrawBox 10 8 61 7
Writeln
WriteCenter '* ' ProgName ' Evaluation Copy *'
Writeln
WriteCenter 'Please remember to register this software.'
Writeln
if Timer and 1 = 0
Jessica = Now - TimeOf('1-17-80') / SecondsInDay / 365 + 2
WriteCenter 'I have a ' Jessica ' year old daughter who wants to go shopping.'
else
WriteCenter "I'd sure hate to have to find a real job."
endif
Wait 600
EraseTopWindow
ClearKbdBuffer
EndProc
Procedure TestFreeMemory
if FreeMemory < 10000
Error('Not Enough Free Memory!',0)
endif
EndProc
Procedure Error (St,Line)
Writeln
if Line > 0
Writeln ProgName ' Error in line ' Line
Writeln St
else
Writeln ProgName ' Error: ' St
endif
ExitCode = 1
ExitMenu
EndProc
;----- INITYME.INC has the conditional logic.
Include 'INITYME.INC'
Procedure LookForCtlFile (Name)
var St
;- IniTools Names
Name = ForceExtension(Name,'CTL')
St = ExistOnPath(Name)
if St > '' then Return St
St = CleanFileName(%CTLDIR% + '\' + Name)
if ExistFile (St) then Return St
;- IniMan Names
Name = ForceExtension(Name,'DEF')
St = ExistOnPath(Name)
if St > '' then Return St
St = CleanFileName(%S_CONFIG% + '\' + Name)
if ExistFile (St) then Return St
Return ''
EndProc
Procedure Setup
var St P
TestFreeMemory
BlankTime = 0
BoxBorderColor Green Blue
BoxInsideColor White Blue
BoxHeaderColor Yellow Mag
;Beg
Quiet = OptionSwitch(CmdLine,'Q')
BackupExtension = 'BNI'
FirstProcessFile = True
ChangeFileName = UpperCase(ParamStr(2))
IniFileName = UpperCase(ParamStr(3))
IniToolMode = MenuFileName contains 'INITOOL'
if IniToolMode
ProgName = 'IniTool'
else
ProgName = 'IniTyme'
endif
ExitCode = 0
RestoreMode = ChangeFileName = 'RESTORE'
if (IniFileName = '')
IniFileName = DefaultExtension(ChangeFileName,'INI')
ChangeFileName = LookForCtlFile(ChangeFileName)
else
if ChangeFileName > ''
if Extension ChangeFileName = ''
St = ForceExtension(ChangeFileName,'INI')
if ExistFile St
ChangeFileName = St
else
ChangeFileName = LookForCtlFile(ChangeFileName)
endif
endif
endif
endif
if not RestoreMode
if (ChangeFileName = '') or not ExistFile(ChangeFileName)
Help
endif
endif
StandardIO
;-- Duplicates List - Add your own duplicates here.
HashLevel = 1
Hash('DEVICE=[386ENH]') = True
if not Quiet then Writeln 'Processing Change File: ' ChangeFileName ' ...'
ReadTextFile(ChangeFileName,Changes)
Loop Changes
Trim(LoopVal)
LoopVal = EnvExpandString(LoopVal)
EndLoop
UChanges = Changes
Loop UChanges
LoopVal = CleanIniLine(LoopVal)
EndLoop
Loop UChanges
if LoopVal StartsWith 'IF '
IfArray[LoopIndex] = LoopVal
LoopVal = ''
Changes[LoopIndex] = ''
PushStack(LoopIndex)
elseif LoopVal StartsWith '**'
;- IniMan Code
delete(LoopVal,1,2)
St = LoopVal
St = NextWord(St)
if St = 'BEGIN'
elseif St = 'END'
elseif St = 'ELSE'
IfArray[LoopIndex] = 'GOTO'
P = 0
Loop LoopIndex + 2 LoopLimit UChanges
;- Search forward for END
if LoopVal = '**END'
P = LoopIndex
LoopIndex = LoopLimit
endif
EndLoop
if P > 0
GotoList[LoopIndex] = P
else
P = LoopLimit
endif
else
LoopVal = 'IF ' + LoopVal
IfArray[LoopIndex] = LoopVal
if UChanges[LoopIndex + 1] = '**BEGIN'
P = 0
Loop LoopIndex + 2 LoopLimit UChanges
;- Search forward for END
if LoopVal = '**END'
P = LoopIndex
LoopIndex = LoopLimit
elseif LoopVal = '**ELSE'
P = LoopIndex
LoopIndex = LoopLimit
endif
EndLoop
if P > 0
GotoList[LoopIndex] = P
else
P = LoopLimit
endif
elseif UChanges[LoopIndex + 1] StartsWith '['
;- Conditional applies to section
Loop LoopIndex + 2 LoopLimit UChanges
;- Search forward for next [Section]
if LoopVal StartsWith '['
P = LoopIndex
LoopIndex = LoopLimit
endif
EndLoop
if P > 0
GotoList[LoopIndex] = P - 1
else
P = LoopLimit
endif
else
GotoList[LoopIndex] = LoopIndex + 1
endif
endif
LoopVal = ''
Changes[LoopIndex] = ''
elseif LoopVal = 'ENDIF'
LoopVal = ''
Changes[LoopIndex] = ''
GotoList[PopStack] = LoopIndex
elseif LoopVal = 'ELSE'
LoopVal = ''
Changes[LoopIndex] = ''
IfArray[LoopIndex] = 'GOTO'
GotoList[PopStack] = LoopIndex
PushStack(LoopIndex)
endif
EndLoop
;-- if you forgot an Endif then the stack contains values.
if NumberOfElements Stack <> 0
Error ('MisMatched Conditionals!',0)
endif
Hash('ADD') = True
Hash('ADDITEM') = True
Hash('ADDVALUE') = True
Hash('AFTER') = True
Hash('APPENDLOG') = True
Hash('BACKUPNAME') = True
Hash('BEFORE') = True
Hash('CHANGE') = True
Hash('DEL') = True
Hash('DELITEM') = True
Hash('DUPLICATES') = True
Hash('FIRST') = True
Hash('LOG') = True
Hash('NOBACKUP') = True
Hash('SUBST') = True
Hash('TESTMODE') = True
Hash('YAK') = True
SetupLibWords
TestFreeMemory
EndProc
Procedure ResetVariables
dispose(NameIndex)
dispose(BlockStartIndex)
dispose(BlockEndIndex)
dispose(SubFind)
dispose(SubReplace)
dispose(SubFindG)
dispose(SubReplaceG)
dispose(GlobalDups)
; HashDisposeLevel(2)
LogGroup = ''
CurrentSection = 0
BackupName = ''
BackupExtension = 'BNI'
EndProc
Procedure BackName
if BackupName > '' then Return BackupName
Return ForceExtension(IniFileName,BackupExtension)
EndProc
Procedure ProcessFile (Name)
var FileList MultiFile X
if InputRedirected and FirstProcessFile
IniFileName = ''
else
IniFileName = DefaultExtension(Name,'INI')
endif
FirstProcessFile = False
ReadTextFile(IniFileName,Orig)
TestFreeMemory
if NumberOfElements Orig > 0
;- Loop Past Comments and blank lines
X = 1
while (X < NumberOfElements(Orig)) and ((Orig[X] StartsWith ';') or (Orig[X] = ''))
X = X + 1
endwhile
if ExistFile(Orig[X])
MultiFile = True
FileList = Orig
Loop FileList
if LoopVal StartsWith ';' then LoopVal = ''
if LoopVal > ''
ProcessFile(LoopVal)
endif
EndLoop
endif
endif
if not MultiFile
if RestoreMode
if ExistFile(BackName)
Writeln 'Restoring ' IniFileName
DelFile(IniFileName)
FileRename(BackName,IniFileName)
else
Writeln BackName ' not Found!'
endif
else
ResetVariables
if not Quiet then Writeln 'Converting INI File: ' IniFileName ' '
NeedsIndexing
ChangeFile
RemoveExtraBlankLines
if TestMode
WriteTextFile(BackName,Orig)
else
DelFile(BackName)
FileRename(IniFileName,BackName)
WriteTextFile(IniFileName,Orig)
endif
if NoBackup
DelFile(BackName)
endif
if Logging
FileClose(LogHandle)
Logging Off
endif
if Yak then Writeln
endif
endif
; Writeln(FreeMemory)
EndProc
Procedure Main
Setup
ProcessFile(IniFileName)
EndProc